package funjava;

/**
 * Created by judasnow on 5/11/16.
 */
public class C1_8 {
    public static void c1_8(String s) {
        for (int i = 0; i<s.length(); i++) {
            if (s.charAt(i) != ' ') {
                System.out.print(s.charAt(i));
            }
        }
    }
    public static void c1_8_2(String s) {
        int strLen = s.length();

        for(int i=0; i<strLen; i++) {
            for(int j=i; j<strLen; j++) {
                String sTmp = s.substring(j, strLen-1);
                if (!sTmp.isEmpty()) {
                    System.out.println(sTmp);
                }
            }
        }
    }
    public static void main(String[] args) {
        c1_8_2("hello world");
    }
}
